package com.moto.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moto.entity.Bolg;
import com.moto.entity.Favorite;
import com.moto.mapper.FavoriteMapper;
import com.moto.service.IFavoriteService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zy
 * @since 2023-08-31
 */
@Service
public class FavoriteServiceImpl extends ServiceImpl<FavoriteMapper, Favorite> implements IFavoriteService {

    @Resource
    private FavoriteMapper favoriteMapper;


    @Override
    public List<Bolg> favoriteList(int id) {
        return favoriteMapper.favoriteList(id);
    }

    /**
     * 收藏列表增加
     * @param
     * @param
     */
    @Transactional
    @Override
    public void addFavorite(Favorite favorite) {
        favoriteMapper.addFavorite(favorite);
    }
}
